QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Color Lookup Table Methods

To write a drawing engine, you might need to implement several private methods for creating and disposing of color lookup tables. Pointers to your drawing engine's color lookup table methods are returned to QuickDraw 3D RAVE by your TQAEngineGetMethod method. See page  [link] for details.

TQAColorTableNew

A drawing engine may define a method to create a new color lookup table. This method is optional and must be supported only by drawing engines that support color lookup tables.

typedef TQAError (*TQAColorTableNew) (
                     TQAColorTableType pixelType,
                     void *pixelData,
                     long transparentIndex,
                     TQAColorTable **newTable);
pixelType
The type of the new color lookup table. See "Color Lookup Table Types" for information on the available color lookup table types.
pixelData
A pointer to the color lookup table entries.
transparentIndexFlag
A long integer, interpreted as a Boolean value, that indicates whether the color lookup table entry at index 0 is completely transparent ( TRUE ) or not ( FALSE ).
newTable
On entry, the address of a pointer variable. On exit, set that variable to point to a new color lookup table. If a new color lookup table cannot be created, set *newTable to the value NULL .

DESCRIPTION

Your TQAColorTableNew function is called whenever an application calls QAColorTableNew . Your function should return, in the buffer pointed to by the newTable parameter, a pointer to a new color lookup table of the type specified by the pixelType parameter. The color table data is passed to your function in the pixelData parameter. Your method should copy that data so that the caller can dispose of the memory it occupies.

Currently, QuickDraw 3D RAVE supports only 32-bit RGB color lookup table entries. Your drawing engine might reduce the size of individual color lookup table entries to fit into its on-board memory.

SPECIAL CONSIDERATIONS

Not all drawing engines need to support color lookup tables, but QuickDraw 3D RAVE does not provide color lookup table emulation for engines that do not support them.

TQAColorTableDelete

A drawing engine may define a method to dispose of color lookup table. This method is optional and must be supported only by drawing engines that support color lookup tables.

typedef void (*TQAColorTableDelete) (TQAColorTable *colorTable);
colorTable
A color lookup table.

DESCRIPTION

Your TQAColorTableDelete function is called whenever an application calls QAColorTableDelete . Your function should delete the color lookup table specified by the colorTable parameter. Any memory and other resources associated with that color lookup table should be released.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |